package com.code.condition;

import com.code.bean.Home;
import org.springframework.beans.factory.FactoryBean;

/**
 * 工厂方法注册bean
 *
 * @author wangjie
 * @version V1.0
 * @date 2020/1/6
 */
public class HomeFactoryBean implements FactoryBean<Home> {

    /**
     *
     * @return 返回一个Home对象，这个对象会添加到容器中
     * @throws Exception
     */
    @Override
    public Home getObject() throws Exception {
        return new Home();
    }

    @Override
    public Class<?> getObjectType() {
        return null;
    }

    /**
     *
     * @return 是否单例
     */
    @Override
    public boolean isSingleton() {
        return true;
    }
}
